/*
 * Copyright (c) Deutsche Bank
 */


package org.sunshine.miracle.web.gwt.client;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

import java.util.Iterator;

/**
 * @author <a href="mailto:anatoliy.evtushenko@db.com">Anatoliy Evtushenko</a>
 * @cvs $Id:$
 */
public class PathHistory extends SimplePanel {

    public PathHistory() {
        super();
       setStyleName("path_history");
        DOM.setElementProperty(getElement(), "className", "path_history");
    }


    public void add(String text){
        Element textDiv = DOM.createDiv();
        DOM.setElementProperty(textDiv, "className", "path_item");
        DOM.setInnerText(textDiv, text);

        DOM.appendChild(getElement(), textDiv);
        appendSeparator(textDiv);
    }

    private void appendSeparator(Element textDiv) {
        Element separator = DOM.createDiv();
        DOM.setElementProperty(textDiv, "className", "separator");
        DOM.appendChild(getElement(), separator);
    }


}
